/**                                
 * Copyright ® 
 * 版权所有。     
 */ 

package com.sy.base.util;


/**
 * <p>Class       : com.sy.util.ExecBatFile
 * <p>Descdription: 类功能描述
 *
 * @author  孙阳-13940238943@139.com
 * @version 1.0.0
 *<p>
 *--------------------------------------------------------------<br>
 * 修改履历：<br>
 *        <li> 2015-3-13，13940238943@139.com，创建文件；<br>
 *--------------------------------------------------------------<br>
 *</p>
 */
public class ExecBatFileUtil {

	/**
	 * <p>Method ：main
	 * <p>Description : 方法功能描述
	 *
	 * @param args 
	 * @author  孙阳-13940238943@139.com
	 *<p>
	 *--------------------------------------------------------------<br>
	 * 修改履历：<br>
	 *        <li> 2015-3-13，13940238943@139.com，创建方法；<br>
	 *--------------------------------------------------------------<br>
	 *</p>
	 */
	public static void main(String[] args) {
		/*  ProcessBuilder builder = new ProcessBuilder();
		  List<String> command = new ArrayList<String>();
		  command.add("D:\\zwdt\\dbbackup.bat");
		  builder.command(command);
	      try {
			builder.start();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		
		Runtime rn = Runtime.getRuntime();
		
		try {
			Process p= rn.exec("cmd.exe /C start D:\\zwdt\\dbbackup.bat");
			int eVal=p.exitValue();
			System.out.println(eVal);
		} catch (Exception e) {
			if(e.getMessage().equals("process has not exited")){
				System.out.println(11);
			}
		}
		
	}
}
